<?php
@session_start();
require_once("database.php");
require_once("libs/functions.php");
require_once('libs/MySQL_connection.php');

	$db = new MySQLConnection($config['sql_host'], $config['sql_username'], $config['sql_password'], $config['sql_database']);
	$db->Connect();
	
	unset($config['sql_password']);
	
// Require Cron
require_once("cron.php");

if (isset($_SESSION['EX_login']))
	{
		$is_online = true;
	}
	else
	{
		$is_online = false;
	}
	
	
  if(isset($_SESSION['EX_login'])){
    $sql				= $db->Query("SELECT *,UNIX_TIMESTAMP(`online`) AS `online` FROM `users` WHERE `login`='{$_SESSION['EX_login']}'");
    $data				= $db->FetchArray($sql);
	if($data['id'] == ''){
		session_destroy();
	}
  }
  
$sql = $db->Query("SELECT * FROM settings LIMIT 1");
$site = $db->FetchArray($sql);
?>